package com.meida.module.bus.provider.service.impl;

import com.meida.common.mybatis.entity.EntityMap;
import com.meida.common.mybatis.model.ResultBody;
import com.meida.common.mybatis.query.CriteriaQuery;
import com.meida.common.mybatis.query.CriteriaSave;
import com.meida.module.bus.client.entity.srmapi.basedata.SrmContractspaymentdtl;
import com.meida.module.bus.provider.mapper.SrmContractspaymentdtlMapper;
import com.meida.module.bus.provider.service.SrmContractspaymentdtlService;
import com.meida.common.mybatis.base.service.impl.BaseServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * srm合同明细付款信息接口实现类
 *
 * @author flyme
 * @date 2020-12-25
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class SrmContractspaymentdtlServiceImpl extends BaseServiceImpl<SrmContractspaymentdtlMapper, SrmContractspaymentdtl> implements SrmContractspaymentdtlService {

    @Override
    public ResultBody beforeAdd(CriteriaSave cs, SrmContractspaymentdtl contractspaymentdtl, EntityMap extra) {
        return ResultBody.ok();
    }



    @Override
    @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
    public ResultBody beforePageList(CriteriaQuery<SrmContractspaymentdtl> cq, SrmContractspaymentdtl contractspaymentdtl, EntityMap requestMap) {
      cq.eq(SrmContractspaymentdtl.class,"paymentDtlId");
      cq.eq(SrmContractspaymentdtl.class,"payStageName");
      cq.eq(SrmContractspaymentdtl.class,"paymentExplain");
      cq.eq(SrmContractspaymentdtl.class,"plannedPaymentAmount");
      cq.eq(SrmContractspaymentdtl.class,"planpayDate");
      cq.eq(SrmContractspaymentdtl.class,"remarks");
      cq.eq(SrmContractspaymentdtl.class,"contractsId");
      cq.eq(SrmContractspaymentdtl.class,"plannedPaymentPercent");
      cq.orderByDesc("contractspaymentdtl.createTime");
      return ResultBody.ok();
    }
}
